Polls

interface Polls

This module is used to manage polls.

Types

Link copied to clipboard
object Companion
Link copied to clipboard

Interface managing all changes on polls.

Functions

Link copied to clipboard
abstract fun createPoll(poll: Poll, listener: RainbowListener<String, Unit>? = null)

Create a poll

Link copied to clipboard
abstract fun deletePoll(pollId: String, listener: RainbowListener<Unit, Unit>? = null)

Delete a poll by its Id.

Link copied to clipboard
abstract fun getPoll(pollId: String, roomId: String, listener: RainbowListener<Poll, Unit>?)

Get a specific poll with its Id and its bubble Id. This poll is returned in the "listener" param.

Link copied to clipboard
abstract fun getPollsForRoom(room: Room, listener: RainbowListener<List<Poll>, Unit>?)

Get all the polls for a given bubble. Those polls are returned in the "listener" param.

Link copied to clipboard
abstract fun publishPoll(pollId: String, listener: RainbowListener<Unit, Unit>? = null)

Publish a poll by its Id. People will be able to vote.

Link copied to clipboard
abstract fun registerChangeListener(pollChangeListener: Polls.PollChangeListener)

Subscribe to changes on a poll. The corresponding poll Id and the bubble Id are provided in the PollChangeListener passed in parameter.

Link copied to clipboard
abstract fun terminatePoll(pollId: String, listener: RainbowListener<Unit, Unit>? = null)

End a poll by its Id.

Link copied to clipboard
abstract fun unPublishPoll(pollId: String, listener: RainbowListener<Unit, Unit>? = null)

Undo the publish a poll by its Id. All votes are lost and people won't be able to vote anymore.

Link copied to clipboard
abstract fun unregisterChangeListener(pollChangeListener: Polls.PollChangeListener)

Unsubscribe to changes on polls.

Link copied to clipboard
abstract fun updatePoll(poll: Poll, listener: RainbowListener<String, Unit>? = null)

Update a poll. The id in the poll must not be null.

Link copied to clipboard
abstract fun voteForPoll(pollId: String, votes: PollVotes, listener: RainbowListener<Unit, Unit>? = null)

Submit the votes for a poll by its Id.